STD = -std=c++20

# dcargo.out : dhttp.o dmain.o ddatabase.o dsocket.o
# 	g++ -g $(STD) -o  $@ $^ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp

# dhttp.o : http.cpp
# 	g++ -g -c $(STD) -o $@ $^

# dmain.o : main.cpp
# 	g++ -g -c $(STD) -o  $@ $^

# dsocket.o :socket.cpp socket.hpp general-exception.hpp
# 	g++ -g -c $(STD) -o  $@ $^

# ddatabase.o : database.cpp
# 	g++ -g -c $(STD) -o  $@ $^ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp

# cargo.out : http.o main.o database.o socket.o
# 	g++ $(STD) -o  $@ $^ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp

# http.o : http.cpp general-exception.hpp socket.hpp database.hpp http.hpp
# 	g++ -c $(STD) -o  $@ http.cpp

# socket.o :socket.cpp socket.hpp general-exception.hpp
# 	g++ -c $(STD) -o  $@ main.cpp

# main.o : main.cpp http.hpp
# 	g++ -c $(STD) -o  $@ main.cpp

# database.o : database.cpp database.hpp
# 	g++ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp -c $(STD) -o  $@ database.cpp

# .PHONY : clean
# clean :
# 	-rm http.o main.o database.o cargo.out
# 	-rm dhttp.o dmain.o ddatabase.o dcargo.out

# debug : dcargo.out
# # release : cargo.out

.PHONY: debug release clean
debug: http.cpp main.cpp socket.cpp database.cpp
	g++ -g $(STD) -o  $@ $^ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp
release: http.cpp main.cpp socket.cpp database.cpp
	g++ $(STD) -o  $@ $^ -I/usr/local/mysqlcppconn/include -L/usr/local/mysqlcppconn/lib -lmysqlcppconn -I/usr/local/include/jsoncpp -L/usr/local/lib -ljsoncpp
clean :
	-rm debug release